<?php


/**
 * Base class that represents a query for the 'car_damages' table.
 *
 *
 *
 * @method DamagesCarDamagesQuery orderById($order = Criteria::ASC) Order by the id column
 * @method DamagesCarDamagesQuery orderByCarDataId($order = Criteria::ASC) Order by the car_data_id column
 * @method DamagesCarDamagesQuery orderByStatusId($order = Criteria::ASC) Order by the status_id column
 * @method DamagesCarDamagesQuery orderByDictPerpetratorId($order = Criteria::ASC) Order by the dict_perpetrator_id column
 * @method DamagesCarDamagesQuery orderByProcessTypeId($order = Criteria::ASC) Order by the process_type_id column
 * @method DamagesCarDamagesQuery orderByRelatedCarDamage($order = Criteria::ASC) Order by the related_car_damage column
 * @method DamagesCarDamagesQuery orderByLsId($order = Criteria::ASC) Order by the ls_id column
 * @method DamagesCarDamagesQuery orderByOlId($order = Criteria::ASC) Order by the ol_id column
 * @method DamagesCarDamagesQuery orderByDiscardId($order = Criteria::ASC) Order by the discard_id column
 * @method DamagesCarDamagesQuery orderByDiscardDescription($order = Criteria::ASC) Order by the discard_description column
 * @method DamagesCarDamagesQuery orderByDamageDate($order = Criteria::ASC) Order by the damage_date column
 * @method DamagesCarDamagesQuery orderByDealerReportDate($order = Criteria::ASC) Order by the dealer_report_date column
 * @method DamagesCarDamagesQuery orderByPerpetratorReportDate($order = Criteria::ASC) Order by the perpetrator_report_date column
 * @method DamagesCarDamagesQuery orderByDamagesDescription($order = Criteria::ASC) Order by the damages_description column
 * @method DamagesCarDamagesQuery orderByDescription($order = Criteria::ASC) Order by the description column
 * @method DamagesCarDamagesQuery orderByCreated($order = Criteria::ASC) Order by the created column
 * @method DamagesCarDamagesQuery orderByModified($order = Criteria::ASC) Order by the modified column
 *
 * @method DamagesCarDamagesQuery groupById() Group by the id column
 * @method DamagesCarDamagesQuery groupByCarDataId() Group by the car_data_id column
 * @method DamagesCarDamagesQuery groupByStatusId() Group by the status_id column
 * @method DamagesCarDamagesQuery groupByDictPerpetratorId() Group by the dict_perpetrator_id column
 * @method DamagesCarDamagesQuery groupByProcessTypeId() Group by the process_type_id column
 * @method DamagesCarDamagesQuery groupByRelatedCarDamage() Group by the related_car_damage column
 * @method DamagesCarDamagesQuery groupByLsId() Group by the ls_id column
 * @method DamagesCarDamagesQuery groupByOlId() Group by the ol_id column
 * @method DamagesCarDamagesQuery groupByDiscardId() Group by the discard_id column
 * @method DamagesCarDamagesQuery groupByDiscardDescription() Group by the discard_description column
 * @method DamagesCarDamagesQuery groupByDamageDate() Group by the damage_date column
 * @method DamagesCarDamagesQuery groupByDealerReportDate() Group by the dealer_report_date column
 * @method DamagesCarDamagesQuery groupByPerpetratorReportDate() Group by the perpetrator_report_date column
 * @method DamagesCarDamagesQuery groupByDamagesDescription() Group by the damages_description column
 * @method DamagesCarDamagesQuery groupByDescription() Group by the description column
 * @method DamagesCarDamagesQuery groupByCreated() Group by the created column
 * @method DamagesCarDamagesQuery groupByModified() Group by the modified column
 *
 * @method DamagesCarDamagesQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method DamagesCarDamagesQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method DamagesCarDamagesQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method DamagesCarDamagesQuery leftJoinCarDamagesRelatedByRelatedCarDamage($relationAlias = null) Adds a LEFT JOIN clause to the query using the CarDamagesRelatedByRelatedCarDamage relation
 * @method DamagesCarDamagesQuery rightJoinCarDamagesRelatedByRelatedCarDamage($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CarDamagesRelatedByRelatedCarDamage relation
 * @method DamagesCarDamagesQuery innerJoinCarDamagesRelatedByRelatedCarDamage($relationAlias = null) Adds a INNER JOIN clause to the query using the CarDamagesRelatedByRelatedCarDamage relation
 *
 * @method DamagesCarDamagesQuery leftJoinDictStatuses($relationAlias = null) Adds a LEFT JOIN clause to the query using the DictStatuses relation
 * @method DamagesCarDamagesQuery rightJoinDictStatuses($relationAlias = null) Adds a RIGHT JOIN clause to the query using the DictStatuses relation
 * @method DamagesCarDamagesQuery innerJoinDictStatuses($relationAlias = null) Adds a INNER JOIN clause to the query using the DictStatuses relation
 *
 * @method DamagesCarDamagesQuery leftJoinCarData($relationAlias = null) Adds a LEFT JOIN clause to the query using the CarData relation
 * @method DamagesCarDamagesQuery rightJoinCarData($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CarData relation
 * @method DamagesCarDamagesQuery innerJoinCarData($relationAlias = null) Adds a INNER JOIN clause to the query using the CarData relation
 *
 * @method DamagesCarDamagesQuery leftJoinUsersRelatedByLsId($relationAlias = null) Adds a LEFT JOIN clause to the query using the UsersRelatedByLsId relation
 * @method DamagesCarDamagesQuery rightJoinUsersRelatedByLsId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the UsersRelatedByLsId relation
 * @method DamagesCarDamagesQuery innerJoinUsersRelatedByLsId($relationAlias = null) Adds a INNER JOIN clause to the query using the UsersRelatedByLsId relation
 *
 * @method DamagesCarDamagesQuery leftJoinUsersRelatedByOlId($relationAlias = null) Adds a LEFT JOIN clause to the query using the UsersRelatedByOlId relation
 * @method DamagesCarDamagesQuery rightJoinUsersRelatedByOlId($relationAlias = null) Adds a RIGHT JOIN clause to the query using the UsersRelatedByOlId relation
 * @method DamagesCarDamagesQuery innerJoinUsersRelatedByOlId($relationAlias = null) Adds a INNER JOIN clause to the query using the UsersRelatedByOlId relation
 *
 * @method DamagesCarDamagesQuery leftJoinDictDiscards($relationAlias = null) Adds a LEFT JOIN clause to the query using the DictDiscards relation
 * @method DamagesCarDamagesQuery rightJoinDictDiscards($relationAlias = null) Adds a RIGHT JOIN clause to the query using the DictDiscards relation
 * @method DamagesCarDamagesQuery innerJoinDictDiscards($relationAlias = null) Adds a INNER JOIN clause to the query using the DictDiscards relation
 *
 * @method DamagesCarDamagesQuery leftJoinDictPerpetrators($relationAlias = null) Adds a LEFT JOIN clause to the query using the DictPerpetrators relation
 * @method DamagesCarDamagesQuery rightJoinDictPerpetrators($relationAlias = null) Adds a RIGHT JOIN clause to the query using the DictPerpetrators relation
 * @method DamagesCarDamagesQuery innerJoinDictPerpetrators($relationAlias = null) Adds a INNER JOIN clause to the query using the DictPerpetrators relation
 *
 * @method DamagesCarDamagesQuery leftJoinProcessTypes($relationAlias = null) Adds a LEFT JOIN clause to the query using the ProcessTypes relation
 * @method DamagesCarDamagesQuery rightJoinProcessTypes($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ProcessTypes relation
 * @method DamagesCarDamagesQuery innerJoinProcessTypes($relationAlias = null) Adds a INNER JOIN clause to the query using the ProcessTypes relation
 *
 * @method DamagesCarDamagesQuery leftJoinAttachments($relationAlias = null) Adds a LEFT JOIN clause to the query using the Attachments relation
 * @method DamagesCarDamagesQuery rightJoinAttachments($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Attachments relation
 * @method DamagesCarDamagesQuery innerJoinAttachments($relationAlias = null) Adds a INNER JOIN clause to the query using the Attachments relation
 *
 * @method DamagesCarDamagesQuery leftJoinCarDamageChangeLogs($relationAlias = null) Adds a LEFT JOIN clause to the query using the CarDamageChangeLogs relation
 * @method DamagesCarDamagesQuery rightJoinCarDamageChangeLogs($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CarDamageChangeLogs relation
 * @method DamagesCarDamagesQuery innerJoinCarDamageChangeLogs($relationAlias = null) Adds a INNER JOIN clause to the query using the CarDamageChangeLogs relation
 *
 * @method DamagesCarDamagesQuery leftJoinCarDamagesRelatedById($relationAlias = null) Adds a LEFT JOIN clause to the query using the CarDamagesRelatedById relation
 * @method DamagesCarDamagesQuery rightJoinCarDamagesRelatedById($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CarDamagesRelatedById relation
 * @method DamagesCarDamagesQuery innerJoinCarDamagesRelatedById($relationAlias = null) Adds a INNER JOIN clause to the query using the CarDamagesRelatedById relation
 *
 * @method DamagesCarDamagesQuery leftJoinDamages($relationAlias = null) Adds a LEFT JOIN clause to the query using the Damages relation
 * @method DamagesCarDamagesQuery rightJoinDamages($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Damages relation
 * @method DamagesCarDamagesQuery innerJoinDamages($relationAlias = null) Adds a INNER JOIN clause to the query using the Damages relation
 *
 * @method DamagesCarDamagesQuery leftJoinEstimatedBudgets($relationAlias = null) Adds a LEFT JOIN clause to the query using the EstimatedBudgets relation
 * @method DamagesCarDamagesQuery rightJoinEstimatedBudgets($relationAlias = null) Adds a RIGHT JOIN clause to the query using the EstimatedBudgets relation
 * @method DamagesCarDamagesQuery innerJoinEstimatedBudgets($relationAlias = null) Adds a INNER JOIN clause to the query using the EstimatedBudgets relation
 *
 * @method DamagesCarDamagesQuery leftJoinInvoices($relationAlias = null) Adds a LEFT JOIN clause to the query using the Invoices relation
 * @method DamagesCarDamagesQuery rightJoinInvoices($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Invoices relation
 * @method DamagesCarDamagesQuery innerJoinInvoices($relationAlias = null) Adds a INNER JOIN clause to the query using the Invoices relation
 *
 * @method DamagesCarDamagesQuery leftJoinNotes($relationAlias = null) Adds a LEFT JOIN clause to the query using the Notes relation
 * @method DamagesCarDamagesQuery rightJoinNotes($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Notes relation
 * @method DamagesCarDamagesQuery innerJoinNotes($relationAlias = null) Adds a INNER JOIN clause to the query using the Notes relation
 *
 * @method DamagesCarDamages findOne(PropelPDO $con = null) Return the first DamagesCarDamages matching the query
 * @method DamagesCarDamages findOneOrCreate(PropelPDO $con = null) Return the first DamagesCarDamages matching the query, or a new DamagesCarDamages object populated from the query conditions when no match is found
 *
 * @method DamagesCarDamages findOneById(int $id) Return the first DamagesCarDamages filtered by the id column
 * @method DamagesCarDamages findOneByCarDataId(int $car_data_id) Return the first DamagesCarDamages filtered by the car_data_id column
 * @method DamagesCarDamages findOneByStatusId(int $status_id) Return the first DamagesCarDamages filtered by the status_id column
 * @method DamagesCarDamages findOneByDictPerpetratorId(int $dict_perpetrator_id) Return the first DamagesCarDamages filtered by the dict_perpetrator_id column
 * @method DamagesCarDamages findOneByProcessTypeId(int $process_type_id) Return the first DamagesCarDamages filtered by the process_type_id column
 * @method DamagesCarDamages findOneByRelatedCarDamage(int $related_car_damage) Return the first DamagesCarDamages filtered by the related_car_damage column
 * @method DamagesCarDamages findOneByLsId(int $ls_id) Return the first DamagesCarDamages filtered by the ls_id column
 * @method DamagesCarDamages findOneByOlId(int $ol_id) Return the first DamagesCarDamages filtered by the ol_id column
 * @method DamagesCarDamages findOneByDiscardId(int $discard_id) Return the first DamagesCarDamages filtered by the discard_id column
 * @method DamagesCarDamages findOneByDiscardDescription(string $discard_description) Return the first DamagesCarDamages filtered by the discard_description column
 * @method DamagesCarDamages findOneByDamageDate(string $damage_date) Return the first DamagesCarDamages filtered by the damage_date column
 * @method DamagesCarDamages findOneByDealerReportDate(string $dealer_report_date) Return the first DamagesCarDamages filtered by the dealer_report_date column
 * @method DamagesCarDamages findOneByPerpetratorReportDate(string $perpetrator_report_date) Return the first DamagesCarDamages filtered by the perpetrator_report_date column
 * @method DamagesCarDamages findOneByDamagesDescription(string $damages_description) Return the first DamagesCarDamages filtered by the damages_description column
 * @method DamagesCarDamages findOneByDescription(string $description) Return the first DamagesCarDamages filtered by the description column
 * @method DamagesCarDamages findOneByCreated(string $created) Return the first DamagesCarDamages filtered by the created column
 * @method DamagesCarDamages findOneByModified(string $modified) Return the first DamagesCarDamages filtered by the modified column
 *
 * @method array findById(int $id) Return DamagesCarDamages objects filtered by the id column
 * @method array findByCarDataId(int $car_data_id) Return DamagesCarDamages objects filtered by the car_data_id column
 * @method array findByStatusId(int $status_id) Return DamagesCarDamages objects filtered by the status_id column
 * @method array findByDictPerpetratorId(int $dict_perpetrator_id) Return DamagesCarDamages objects filtered by the dict_perpetrator_id column
 * @method array findByProcessTypeId(int $process_type_id) Return DamagesCarDamages objects filtered by the process_type_id column
 * @method array findByRelatedCarDamage(int $related_car_damage) Return DamagesCarDamages objects filtered by the related_car_damage column
 * @method array findByLsId(int $ls_id) Return DamagesCarDamages objects filtered by the ls_id column
 * @method array findByOlId(int $ol_id) Return DamagesCarDamages objects filtered by the ol_id column
 * @method array findByDiscardId(int $discard_id) Return DamagesCarDamages objects filtered by the discard_id column
 * @method array findByDiscardDescription(string $discard_description) Return DamagesCarDamages objects filtered by the discard_description column
 * @method array findByDamageDate(string $damage_date) Return DamagesCarDamages objects filtered by the damage_date column
 * @method array findByDealerReportDate(string $dealer_report_date) Return DamagesCarDamages objects filtered by the dealer_report_date column
 * @method array findByPerpetratorReportDate(string $perpetrator_report_date) Return DamagesCarDamages objects filtered by the perpetrator_report_date column
 * @method array findByDamagesDescription(string $damages_description) Return DamagesCarDamages objects filtered by the damages_description column
 * @method array findByDescription(string $description) Return DamagesCarDamages objects filtered by the description column
 * @method array findByCreated(string $created) Return DamagesCarDamages objects filtered by the created column
 * @method array findByModified(string $modified) Return DamagesCarDamages objects filtered by the modified column
 *
 * @package    propel.generator.damages.om
 */
abstract class DamagesBaseCarDamagesQuery extends ModelCriteria
{
    /**
     * Initializes internal state of DamagesBaseCarDamagesQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_damages', $modelName = 'DamagesCarDamages', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new DamagesCarDamagesQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     DamagesCarDamagesQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return DamagesCarDamagesQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof DamagesCarDamagesQuery) {
            return $criteria;
        }
        $query = new DamagesCarDamagesQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj  = $c->findPk(12, $con);
     * </code>
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   DamagesCarDamages|DamagesCarDamages[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = DamagesCarDamagesPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(DamagesCarDamagesPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   DamagesCarDamages A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT ID, CAR_DATA_ID, STATUS_ID, DICT_PERPETRATOR_ID, PROCESS_TYPE_ID, RELATED_CAR_DAMAGE, LS_ID, OL_ID, DISCARD_ID, DISCARD_DESCRIPTION, DAMAGE_DATE, DEALER_REPORT_DATE, PERPETRATOR_REPORT_DATE, DAMAGES_DESCRIPTION, DESCRIPTION, CREATED, MODIFIED FROM car_damages WHERE ID = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new DamagesCarDamages();
            $obj->hydrate($row);
            DamagesCarDamagesPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return DamagesCarDamages|DamagesCarDamages[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(12, 56, 832), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|DamagesCarDamages[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(DamagesCarDamagesPeer::ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(DamagesCarDamagesPeer::ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the id column
     *
     * Example usage:
     * <code>
     * $query->filterById(1234); // WHERE id = 1234
     * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
     * $query->filterById(array('min' => 12)); // WHERE id > 12
     * </code>
     *
     * @param     mixed $id The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::ID, $id, $comparison);
    }

    /**
     * Filter the query on the car_data_id column
     *
     * Example usage:
     * <code>
     * $query->filterByCarDataId(1234); // WHERE car_data_id = 1234
     * $query->filterByCarDataId(array(12, 34)); // WHERE car_data_id IN (12, 34)
     * $query->filterByCarDataId(array('min' => 12)); // WHERE car_data_id > 12
     * </code>
     *
     * @see       filterByCarData()
     *
     * @param     mixed $carDataId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByCarDataId($carDataId = null, $comparison = null)
    {
        if (is_array($carDataId)) {
            $useMinMax = false;
            if (isset($carDataId['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::CAR_DATA_ID, $carDataId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($carDataId['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::CAR_DATA_ID, $carDataId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::CAR_DATA_ID, $carDataId, $comparison);
    }

    /**
     * Filter the query on the status_id column
     *
     * Example usage:
     * <code>
     * $query->filterByStatusId(1234); // WHERE status_id = 1234
     * $query->filterByStatusId(array(12, 34)); // WHERE status_id IN (12, 34)
     * $query->filterByStatusId(array('min' => 12)); // WHERE status_id > 12
     * </code>
     *
     * @see       filterByDictStatuses()
     *
     * @param     mixed $statusId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByStatusId($statusId = null, $comparison = null)
    {
        if (is_array($statusId)) {
            $useMinMax = false;
            if (isset($statusId['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::STATUS_ID, $statusId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($statusId['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::STATUS_ID, $statusId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::STATUS_ID, $statusId, $comparison);
    }

    /**
     * Filter the query on the dict_perpetrator_id column
     *
     * Example usage:
     * <code>
     * $query->filterByDictPerpetratorId(1234); // WHERE dict_perpetrator_id = 1234
     * $query->filterByDictPerpetratorId(array(12, 34)); // WHERE dict_perpetrator_id IN (12, 34)
     * $query->filterByDictPerpetratorId(array('min' => 12)); // WHERE dict_perpetrator_id > 12
     * </code>
     *
     * @see       filterByDictPerpetrators()
     *
     * @param     mixed $dictPerpetratorId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByDictPerpetratorId($dictPerpetratorId = null, $comparison = null)
    {
        if (is_array($dictPerpetratorId)) {
            $useMinMax = false;
            if (isset($dictPerpetratorId['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DICT_PERPETRATOR_ID, $dictPerpetratorId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($dictPerpetratorId['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DICT_PERPETRATOR_ID, $dictPerpetratorId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::DICT_PERPETRATOR_ID, $dictPerpetratorId, $comparison);
    }

    /**
     * Filter the query on the process_type_id column
     *
     * Example usage:
     * <code>
     * $query->filterByProcessTypeId(1234); // WHERE process_type_id = 1234
     * $query->filterByProcessTypeId(array(12, 34)); // WHERE process_type_id IN (12, 34)
     * $query->filterByProcessTypeId(array('min' => 12)); // WHERE process_type_id > 12
     * </code>
     *
     * @see       filterByProcessTypes()
     *
     * @param     mixed $processTypeId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByProcessTypeId($processTypeId = null, $comparison = null)
    {
        if (is_array($processTypeId)) {
            $useMinMax = false;
            if (isset($processTypeId['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::PROCESS_TYPE_ID, $processTypeId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($processTypeId['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::PROCESS_TYPE_ID, $processTypeId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::PROCESS_TYPE_ID, $processTypeId, $comparison);
    }

    /**
     * Filter the query on the related_car_damage column
     *
     * Example usage:
     * <code>
     * $query->filterByRelatedCarDamage(1234); // WHERE related_car_damage = 1234
     * $query->filterByRelatedCarDamage(array(12, 34)); // WHERE related_car_damage IN (12, 34)
     * $query->filterByRelatedCarDamage(array('min' => 12)); // WHERE related_car_damage > 12
     * </code>
     *
     * @see       filterByCarDamagesRelatedByRelatedCarDamage()
     *
     * @param     mixed $relatedCarDamage The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByRelatedCarDamage($relatedCarDamage = null, $comparison = null)
    {
        if (is_array($relatedCarDamage)) {
            $useMinMax = false;
            if (isset($relatedCarDamage['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::RELATED_CAR_DAMAGE, $relatedCarDamage['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($relatedCarDamage['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::RELATED_CAR_DAMAGE, $relatedCarDamage['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::RELATED_CAR_DAMAGE, $relatedCarDamage, $comparison);
    }

    /**
     * Filter the query on the ls_id column
     *
     * Example usage:
     * <code>
     * $query->filterByLsId(1234); // WHERE ls_id = 1234
     * $query->filterByLsId(array(12, 34)); // WHERE ls_id IN (12, 34)
     * $query->filterByLsId(array('min' => 12)); // WHERE ls_id > 12
     * </code>
     *
     * @see       filterByUsersRelatedByLsId()
     *
     * @param     mixed $lsId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByLsId($lsId = null, $comparison = null)
    {
        if (is_array($lsId)) {
            $useMinMax = false;
            if (isset($lsId['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::LS_ID, $lsId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lsId['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::LS_ID, $lsId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::LS_ID, $lsId, $comparison);
    }

    /**
     * Filter the query on the ol_id column
     *
     * Example usage:
     * <code>
     * $query->filterByOlId(1234); // WHERE ol_id = 1234
     * $query->filterByOlId(array(12, 34)); // WHERE ol_id IN (12, 34)
     * $query->filterByOlId(array('min' => 12)); // WHERE ol_id > 12
     * </code>
     *
     * @see       filterByUsersRelatedByOlId()
     *
     * @param     mixed $olId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByOlId($olId = null, $comparison = null)
    {
        if (is_array($olId)) {
            $useMinMax = false;
            if (isset($olId['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::OL_ID, $olId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($olId['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::OL_ID, $olId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::OL_ID, $olId, $comparison);
    }

    /**
     * Filter the query on the discard_id column
     *
     * Example usage:
     * <code>
     * $query->filterByDiscardId(1234); // WHERE discard_id = 1234
     * $query->filterByDiscardId(array(12, 34)); // WHERE discard_id IN (12, 34)
     * $query->filterByDiscardId(array('min' => 12)); // WHERE discard_id > 12
     * </code>
     *
     * @see       filterByDictDiscards()
     *
     * @param     mixed $discardId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByDiscardId($discardId = null, $comparison = null)
    {
        if (is_array($discardId)) {
            $useMinMax = false;
            if (isset($discardId['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DISCARD_ID, $discardId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($discardId['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DISCARD_ID, $discardId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::DISCARD_ID, $discardId, $comparison);
    }

    /**
     * Filter the query on the discard_description column
     *
     * Example usage:
     * <code>
     * $query->filterByDiscardDescription('fooValue');   // WHERE discard_description = 'fooValue'
     * $query->filterByDiscardDescription('%fooValue%'); // WHERE discard_description LIKE '%fooValue%'
     * </code>
     *
     * @param     string $discardDescription The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByDiscardDescription($discardDescription = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($discardDescription)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $discardDescription)) {
                $discardDescription = str_replace('*', '%', $discardDescription);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::DISCARD_DESCRIPTION, $discardDescription, $comparison);
    }

    /**
     * Filter the query on the damage_date column
     *
     * Example usage:
     * <code>
     * $query->filterByDamageDate('2011-03-14'); // WHERE damage_date = '2011-03-14'
     * $query->filterByDamageDate('now'); // WHERE damage_date = '2011-03-14'
     * $query->filterByDamageDate(array('max' => 'yesterday')); // WHERE damage_date > '2011-03-13'
     * </code>
     *
     * @param     mixed $damageDate The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByDamageDate($damageDate = null, $comparison = null)
    {
        if (is_array($damageDate)) {
            $useMinMax = false;
            if (isset($damageDate['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DAMAGE_DATE, $damageDate['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($damageDate['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DAMAGE_DATE, $damageDate['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::DAMAGE_DATE, $damageDate, $comparison);
    }

    /**
     * Filter the query on the dealer_report_date column
     *
     * Example usage:
     * <code>
     * $query->filterByDealerReportDate('2011-03-14'); // WHERE dealer_report_date = '2011-03-14'
     * $query->filterByDealerReportDate('now'); // WHERE dealer_report_date = '2011-03-14'
     * $query->filterByDealerReportDate(array('max' => 'yesterday')); // WHERE dealer_report_date > '2011-03-13'
     * </code>
     *
     * @param     mixed $dealerReportDate The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByDealerReportDate($dealerReportDate = null, $comparison = null)
    {
        if (is_array($dealerReportDate)) {
            $useMinMax = false;
            if (isset($dealerReportDate['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DEALER_REPORT_DATE, $dealerReportDate['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($dealerReportDate['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::DEALER_REPORT_DATE, $dealerReportDate['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::DEALER_REPORT_DATE, $dealerReportDate, $comparison);
    }

    /**
     * Filter the query on the perpetrator_report_date column
     *
     * Example usage:
     * <code>
     * $query->filterByPerpetratorReportDate('2011-03-14'); // WHERE perpetrator_report_date = '2011-03-14'
     * $query->filterByPerpetratorReportDate('now'); // WHERE perpetrator_report_date = '2011-03-14'
     * $query->filterByPerpetratorReportDate(array('max' => 'yesterday')); // WHERE perpetrator_report_date > '2011-03-13'
     * </code>
     *
     * @param     mixed $perpetratorReportDate The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByPerpetratorReportDate($perpetratorReportDate = null, $comparison = null)
    {
        if (is_array($perpetratorReportDate)) {
            $useMinMax = false;
            if (isset($perpetratorReportDate['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::PERPETRATOR_REPORT_DATE, $perpetratorReportDate['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($perpetratorReportDate['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::PERPETRATOR_REPORT_DATE, $perpetratorReportDate['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::PERPETRATOR_REPORT_DATE, $perpetratorReportDate, $comparison);
    }

    /**
     * Filter the query on the damages_description column
     *
     * Example usage:
     * <code>
     * $query->filterByDamagesDescription('fooValue');   // WHERE damages_description = 'fooValue'
     * $query->filterByDamagesDescription('%fooValue%'); // WHERE damages_description LIKE '%fooValue%'
     * </code>
     *
     * @param     string $damagesDescription The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByDamagesDescription($damagesDescription = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($damagesDescription)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $damagesDescription)) {
                $damagesDescription = str_replace('*', '%', $damagesDescription);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::DAMAGES_DESCRIPTION, $damagesDescription, $comparison);
    }

    /**
     * Filter the query on the description column
     *
     * Example usage:
     * <code>
     * $query->filterByDescription('fooValue');   // WHERE description = 'fooValue'
     * $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
     * </code>
     *
     * @param     string $description The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByDescription($description = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($description)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $description)) {
                $description = str_replace('*', '%', $description);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::DESCRIPTION, $description, $comparison);
    }

    /**
     * Filter the query on the created column
     *
     * Example usage:
     * <code>
     * $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14'
     * $query->filterByCreated('now'); // WHERE created = '2011-03-14'
     * $query->filterByCreated(array('max' => 'yesterday')); // WHERE created > '2011-03-13'
     * </code>
     *
     * @param     mixed $created The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByCreated($created = null, $comparison = null)
    {
        if (is_array($created)) {
            $useMinMax = false;
            if (isset($created['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($created['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::CREATED, $created, $comparison);
    }

    /**
     * Filter the query on the modified column
     *
     * Example usage:
     * <code>
     * $query->filterByModified('2011-03-14'); // WHERE modified = '2011-03-14'
     * $query->filterByModified('now'); // WHERE modified = '2011-03-14'
     * $query->filterByModified(array('max' => 'yesterday')); // WHERE modified > '2011-03-13'
     * </code>
     *
     * @param     mixed $modified The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function filterByModified($modified = null, $comparison = null)
    {
        if (is_array($modified)) {
            $useMinMax = false;
            if (isset($modified['min'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::MODIFIED, $modified['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($modified['max'])) {
                $this->addUsingAlias(DamagesCarDamagesPeer::MODIFIED, $modified['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(DamagesCarDamagesPeer::MODIFIED, $modified, $comparison);
    }

    /**
     * Filter the query by a related DamagesCarDamages object
     *
     * @param   DamagesCarDamages|PropelObjectCollection $carDamages The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByCarDamagesRelatedByRelatedCarDamage($carDamages, $comparison = null)
    {
        if ($carDamages instanceof DamagesCarDamages) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::RELATED_CAR_DAMAGE, $carDamages->getId(), $comparison);
        } elseif ($carDamages instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::RELATED_CAR_DAMAGE, $carDamages->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByCarDamagesRelatedByRelatedCarDamage() only accepts arguments of type DamagesCarDamages or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the CarDamagesRelatedByRelatedCarDamage relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinCarDamagesRelatedByRelatedCarDamage($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('CarDamagesRelatedByRelatedCarDamage');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'CarDamagesRelatedByRelatedCarDamage');
        }

        return $this;
    }

    /**
     * Use the CarDamagesRelatedByRelatedCarDamage relation CarDamages object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesCarDamagesQuery A secondary query class using the current class as primary query
     */
    public function useCarDamagesRelatedByRelatedCarDamageQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinCarDamagesRelatedByRelatedCarDamage($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'CarDamagesRelatedByRelatedCarDamage', 'DamagesCarDamagesQuery');
    }

    /**
     * Filter the query by a related DamagesDictStatuses object
     *
     * @param   DamagesDictStatuses|PropelObjectCollection $dictStatuses The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByDictStatuses($dictStatuses, $comparison = null)
    {
        if ($dictStatuses instanceof DamagesDictStatuses) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::STATUS_ID, $dictStatuses->getId(), $comparison);
        } elseif ($dictStatuses instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::STATUS_ID, $dictStatuses->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByDictStatuses() only accepts arguments of type DamagesDictStatuses or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the DictStatuses relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinDictStatuses($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('DictStatuses');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'DictStatuses');
        }

        return $this;
    }

    /**
     * Use the DictStatuses relation DictStatuses object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesDictStatusesQuery A secondary query class using the current class as primary query
     */
    public function useDictStatusesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinDictStatuses($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'DictStatuses', 'DamagesDictStatusesQuery');
    }

    /**
     * Filter the query by a related DamagesCarData object
     *
     * @param   DamagesCarData|PropelObjectCollection $carData The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByCarData($carData, $comparison = null)
    {
        if ($carData instanceof DamagesCarData) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::CAR_DATA_ID, $carData->getId(), $comparison);
        } elseif ($carData instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::CAR_DATA_ID, $carData->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByCarData() only accepts arguments of type DamagesCarData or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the CarData relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinCarData($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('CarData');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'CarData');
        }

        return $this;
    }

    /**
     * Use the CarData relation CarData object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesCarDataQuery A secondary query class using the current class as primary query
     */
    public function useCarDataQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinCarData($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'CarData', 'DamagesCarDataQuery');
    }

    /**
     * Filter the query by a related DamagesUsers object
     *
     * @param   DamagesUsers|PropelObjectCollection $users The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUsersRelatedByLsId($users, $comparison = null)
    {
        if ($users instanceof DamagesUsers) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::LS_ID, $users->getId(), $comparison);
        } elseif ($users instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::LS_ID, $users->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByUsersRelatedByLsId() only accepts arguments of type DamagesUsers or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the UsersRelatedByLsId relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinUsersRelatedByLsId($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('UsersRelatedByLsId');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'UsersRelatedByLsId');
        }

        return $this;
    }

    /**
     * Use the UsersRelatedByLsId relation Users object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesUsersQuery A secondary query class using the current class as primary query
     */
    public function useUsersRelatedByLsIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinUsersRelatedByLsId($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'UsersRelatedByLsId', 'DamagesUsersQuery');
    }

    /**
     * Filter the query by a related DamagesUsers object
     *
     * @param   DamagesUsers|PropelObjectCollection $users The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByUsersRelatedByOlId($users, $comparison = null)
    {
        if ($users instanceof DamagesUsers) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::OL_ID, $users->getId(), $comparison);
        } elseif ($users instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::OL_ID, $users->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByUsersRelatedByOlId() only accepts arguments of type DamagesUsers or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the UsersRelatedByOlId relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinUsersRelatedByOlId($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('UsersRelatedByOlId');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'UsersRelatedByOlId');
        }

        return $this;
    }

    /**
     * Use the UsersRelatedByOlId relation Users object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesUsersQuery A secondary query class using the current class as primary query
     */
    public function useUsersRelatedByOlIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinUsersRelatedByOlId($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'UsersRelatedByOlId', 'DamagesUsersQuery');
    }

    /**
     * Filter the query by a related DamagesDictDiscards object
     *
     * @param   DamagesDictDiscards|PropelObjectCollection $dictDiscards The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByDictDiscards($dictDiscards, $comparison = null)
    {
        if ($dictDiscards instanceof DamagesDictDiscards) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::DISCARD_ID, $dictDiscards->getId(), $comparison);
        } elseif ($dictDiscards instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::DISCARD_ID, $dictDiscards->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByDictDiscards() only accepts arguments of type DamagesDictDiscards or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the DictDiscards relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinDictDiscards($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('DictDiscards');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'DictDiscards');
        }

        return $this;
    }

    /**
     * Use the DictDiscards relation DictDiscards object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesDictDiscardsQuery A secondary query class using the current class as primary query
     */
    public function useDictDiscardsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinDictDiscards($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'DictDiscards', 'DamagesDictDiscardsQuery');
    }

    /**
     * Filter the query by a related DamagesDictPerpetrators object
     *
     * @param   DamagesDictPerpetrators|PropelObjectCollection $dictPerpetrators The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByDictPerpetrators($dictPerpetrators, $comparison = null)
    {
        if ($dictPerpetrators instanceof DamagesDictPerpetrators) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::DICT_PERPETRATOR_ID, $dictPerpetrators->getId(), $comparison);
        } elseif ($dictPerpetrators instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::DICT_PERPETRATOR_ID, $dictPerpetrators->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByDictPerpetrators() only accepts arguments of type DamagesDictPerpetrators or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the DictPerpetrators relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinDictPerpetrators($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('DictPerpetrators');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'DictPerpetrators');
        }

        return $this;
    }

    /**
     * Use the DictPerpetrators relation DictPerpetrators object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesDictPerpetratorsQuery A secondary query class using the current class as primary query
     */
    public function useDictPerpetratorsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinDictPerpetrators($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'DictPerpetrators', 'DamagesDictPerpetratorsQuery');
    }

    /**
     * Filter the query by a related DamagesProcessTypes object
     *
     * @param   DamagesProcessTypes|PropelObjectCollection $processTypes The related object(s) to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByProcessTypes($processTypes, $comparison = null)
    {
        if ($processTypes instanceof DamagesProcessTypes) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::PROCESS_TYPE_ID, $processTypes->getId(), $comparison);
        } elseif ($processTypes instanceof PropelObjectCollection) {
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }

            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::PROCESS_TYPE_ID, $processTypes->toKeyValue('PrimaryKey', 'Id'), $comparison);
        } else {
            throw new PropelException('filterByProcessTypes() only accepts arguments of type DamagesProcessTypes or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the ProcessTypes relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinProcessTypes($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('ProcessTypes');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'ProcessTypes');
        }

        return $this;
    }

    /**
     * Use the ProcessTypes relation ProcessTypes object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesProcessTypesQuery A secondary query class using the current class as primary query
     */
    public function useProcessTypesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinProcessTypes($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'ProcessTypes', 'DamagesProcessTypesQuery');
    }

    /**
     * Filter the query by a related DamagesAttachments object
     *
     * @param   DamagesAttachments|PropelObjectCollection $attachments  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByAttachments($attachments, $comparison = null)
    {
        if ($attachments instanceof DamagesAttachments) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::ID, $attachments->getCarDamageId(), $comparison);
        } elseif ($attachments instanceof PropelObjectCollection) {
            return $this
                ->useAttachmentsQuery()
                ->filterByPrimaryKeys($attachments->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByAttachments() only accepts arguments of type DamagesAttachments or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Attachments relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinAttachments($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Attachments');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Attachments');
        }

        return $this;
    }

    /**
     * Use the Attachments relation Attachments object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesAttachmentsQuery A secondary query class using the current class as primary query
     */
    public function useAttachmentsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinAttachments($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Attachments', 'DamagesAttachmentsQuery');
    }

    /**
     * Filter the query by a related DamagesCarDamageChangeLogs object
     *
     * @param   DamagesCarDamageChangeLogs|PropelObjectCollection $carDamageChangeLogs  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByCarDamageChangeLogs($carDamageChangeLogs, $comparison = null)
    {
        if ($carDamageChangeLogs instanceof DamagesCarDamageChangeLogs) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::ID, $carDamageChangeLogs->getCarDamagesId(), $comparison);
        } elseif ($carDamageChangeLogs instanceof PropelObjectCollection) {
            return $this
                ->useCarDamageChangeLogsQuery()
                ->filterByPrimaryKeys($carDamageChangeLogs->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByCarDamageChangeLogs() only accepts arguments of type DamagesCarDamageChangeLogs or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the CarDamageChangeLogs relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinCarDamageChangeLogs($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('CarDamageChangeLogs');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'CarDamageChangeLogs');
        }

        return $this;
    }

    /**
     * Use the CarDamageChangeLogs relation CarDamageChangeLogs object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesCarDamageChangeLogsQuery A secondary query class using the current class as primary query
     */
    public function useCarDamageChangeLogsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinCarDamageChangeLogs($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'CarDamageChangeLogs', 'DamagesCarDamageChangeLogsQuery');
    }

    /**
     * Filter the query by a related DamagesCarDamages object
     *
     * @param   DamagesCarDamages|PropelObjectCollection $carDamages  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByCarDamagesRelatedById($carDamages, $comparison = null)
    {
        if ($carDamages instanceof DamagesCarDamages) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::ID, $carDamages->getRelatedCarDamage(), $comparison);
        } elseif ($carDamages instanceof PropelObjectCollection) {
            return $this
                ->useCarDamagesRelatedByIdQuery()
                ->filterByPrimaryKeys($carDamages->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByCarDamagesRelatedById() only accepts arguments of type DamagesCarDamages or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the CarDamagesRelatedById relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinCarDamagesRelatedById($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('CarDamagesRelatedById');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'CarDamagesRelatedById');
        }

        return $this;
    }

    /**
     * Use the CarDamagesRelatedById relation CarDamages object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesCarDamagesQuery A secondary query class using the current class as primary query
     */
    public function useCarDamagesRelatedByIdQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinCarDamagesRelatedById($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'CarDamagesRelatedById', 'DamagesCarDamagesQuery');
    }

    /**
     * Filter the query by a related DamagesDamages object
     *
     * @param   DamagesDamages|PropelObjectCollection $damages  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByDamages($damages, $comparison = null)
    {
        if ($damages instanceof DamagesDamages) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::ID, $damages->getCarDamageId(), $comparison);
        } elseif ($damages instanceof PropelObjectCollection) {
            return $this
                ->useDamagesQuery()
                ->filterByPrimaryKeys($damages->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByDamages() only accepts arguments of type DamagesDamages or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Damages relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinDamages($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Damages');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Damages');
        }

        return $this;
    }

    /**
     * Use the Damages relation Damages object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesDamagesQuery A secondary query class using the current class as primary query
     */
    public function useDamagesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinDamages($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Damages', 'DamagesDamagesQuery');
    }

    /**
     * Filter the query by a related DamagesEstimatedBudgets object
     *
     * @param   DamagesEstimatedBudgets|PropelObjectCollection $estimatedBudgets  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEstimatedBudgets($estimatedBudgets, $comparison = null)
    {
        if ($estimatedBudgets instanceof DamagesEstimatedBudgets) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::ID, $estimatedBudgets->getCarDamageId(), $comparison);
        } elseif ($estimatedBudgets instanceof PropelObjectCollection) {
            return $this
                ->useEstimatedBudgetsQuery()
                ->filterByPrimaryKeys($estimatedBudgets->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByEstimatedBudgets() only accepts arguments of type DamagesEstimatedBudgets or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the EstimatedBudgets relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinEstimatedBudgets($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('EstimatedBudgets');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'EstimatedBudgets');
        }

        return $this;
    }

    /**
     * Use the EstimatedBudgets relation EstimatedBudgets object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesEstimatedBudgetsQuery A secondary query class using the current class as primary query
     */
    public function useEstimatedBudgetsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinEstimatedBudgets($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'EstimatedBudgets', 'DamagesEstimatedBudgetsQuery');
    }

    /**
     * Filter the query by a related DamagesInvoices object
     *
     * @param   DamagesInvoices|PropelObjectCollection $invoices  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByInvoices($invoices, $comparison = null)
    {
        if ($invoices instanceof DamagesInvoices) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::ID, $invoices->getCarDamageId(), $comparison);
        } elseif ($invoices instanceof PropelObjectCollection) {
            return $this
                ->useInvoicesQuery()
                ->filterByPrimaryKeys($invoices->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByInvoices() only accepts arguments of type DamagesInvoices or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Invoices relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinInvoices($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Invoices');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Invoices');
        }

        return $this;
    }

    /**
     * Use the Invoices relation Invoices object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesInvoicesQuery A secondary query class using the current class as primary query
     */
    public function useInvoicesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinInvoices($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Invoices', 'DamagesInvoicesQuery');
    }

    /**
     * Filter the query by a related DamagesNotes object
     *
     * @param   DamagesNotes|PropelObjectCollection $notes  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   DamagesCarDamagesQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByNotes($notes, $comparison = null)
    {
        if ($notes instanceof DamagesNotes) {
            return $this
                ->addUsingAlias(DamagesCarDamagesPeer::ID, $notes->getCarDamageId(), $comparison);
        } elseif ($notes instanceof PropelObjectCollection) {
            return $this
                ->useNotesQuery()
                ->filterByPrimaryKeys($notes->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByNotes() only accepts arguments of type DamagesNotes or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the Notes relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function joinNotes($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('Notes');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'Notes');
        }

        return $this;
    }

    /**
     * Use the Notes relation Notes object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   DamagesNotesQuery A secondary query class using the current class as primary query
     */
    public function useNotesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
    {
        return $this
            ->joinNotes($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'Notes', 'DamagesNotesQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   DamagesCarDamages $carDamages Object to remove from the list of results
     *
     * @return DamagesCarDamagesQuery The current query, for fluid interface
     */
    public function prune($carDamages = null)
    {
        if ($carDamages) {
            $this->addUsingAlias(DamagesCarDamagesPeer::ID, $carDamages->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}
